package pl.edu.pw.polygen.ui.help;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;

@Component
@Scope("prototype")
public class AboutWindow extends Window {
	
	private static final long serialVersionUID = 3439452761531103410L;
	private Logger LOG = Logger.getLogger(AboutWindow.class);
	private static String WINDOW_WIDTH = "600px"; 
	private static String WINDOW_HEIGHT = "400px";
	private Label message;
	private static String windowName = "About WebPolygen";
	
	public AboutWindow() {
		super(windowName);
		this.initialize();
	}

	private void initialize() {
		setModal(true);
		setWidth(WINDOW_WIDTH);
		setHeight(WINDOW_HEIGHT);
		VerticalLayout layout = (VerticalLayout) this.getContent();
		layout.setMargin(true);
		layout.setSpacing(true);
		addComponent(getMessage());
	}

	private Label getMessage() {
		if (message == null) {
			message = new Label("This is a modal subwindow.");
		}
		return message;
	}
}
